import 'package:flutter/material.dart';
import 'package:test1/bean/ItemInfo.dart';
import 'package:test1/listitems/HomeListItem.dart';
import 'package:test1/View/TextWdigetPage.dart';

class ListView_Normal_Page extends StatelessWidget {
  var list = [
    ItemInfo("ListView的一行数据"),
    ItemInfo("ListView的一行数据"),
    ItemInfo("ListView的一行数据"),
    ItemInfo("ListView的一行数据")
  ];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("ListView"),
        ),
        body: ListView(
          children: <Widget>[
            HomeListItem(0, list[0], (index) =>
                Navigator.push(
                    context,
                    new MaterialPageRoute(builder: (BuildContext context) {
                      return TextWdigetPage();
                    })
                )
            ),
            HomeListItem(1, list[1], (index) =>
                Navigator.push(
                    context,
                    new MaterialPageRoute(builder: (BuildContext context) {
                      return TextWdigetPage();
                    })
                )
            ),
            HomeListItem(2, list[2], (index) =>
                Navigator.push(
                    context,
                    new MaterialPageRoute(builder: (BuildContext context) {
                      return TextWdigetPage();
                    })
                )
            ),
            HomeListItem(3, list[3], (index) =>
                Navigator.push(
                    context,
                    new MaterialPageRoute(builder: (BuildContext context) {
                      return TextWdigetPage();
                    })
                )
            ),
          ],
        ),
      ),
    );
  }
}